package com.iotechn.unimall.app.api.rechargeable;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.RechargeableDO;

import java.util.List;

@HttpOpenApi(group = "rechargeable", description = "微信充值")
public interface RechargeableAppService {

    @HttpMethod(description = "微信充值活动列表")
    public List<RechargeableDO>  getRechargeableDOList()  throws ServiceException;

    /**
this.$api.request('rechargeable', 'payRechargeable',{
     */
    @HttpMethod(description = "  活动内微信充值支付")
    public String payRechargeable(
            @NotNull @HttpParam(name = "rechargeableDO", type = HttpParamType.COMMON, description = "支付信息") RechargeableDO rechargeableDO,
            @NotNull @HttpParam(name = "channel", type = HttpParamType.COMMON, description = "下单渠道") String channel,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户id")  Long userId) throws ServiceException;

    @HttpMethod(description = "  自定义微信充值支付")
    public String payRechargeableCustom(
            @NotNull @HttpParam(name = "channel", type = HttpParamType.COMMON, description = "下单渠道") String channel,
            @NotNull @HttpParam(name = "amount", type = HttpParamType.COMMON, description = "自定义支付金额") Integer amount,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户id")  Long userId) throws ServiceException;

    @HttpMethod(description = "微信小程序预先支付")
    public Object wxPrepay(
            @NotNull @HttpParam(name = "orderNo", type = HttpParamType.COMMON, description = "订单串号") String orderNo,
            @NotNull @HttpParam(name = "ip", type = HttpParamType.IP, description = "ip地址") String ip,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户id")  Long userId) throws ServiceException;


    @HttpMethod(description = "微信小程序预先支付")
    public Object getReward(
            @NotNull @HttpParam(name = "orderNo", type = HttpParamType.COMMON, description = "订单串号") String orderNo,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户id")  Long userId
    ) throws ServiceException;


    @HttpMethod(description = "充值退款")
    public  Object refundReward(
            @NotNull @HttpParam(name = "orderNo", type = HttpParamType.COMMON, description = "充值订单号") String orderNo,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户id")  Long userId
    ) throws ServiceException;
}
